What are the errors you are getting on OS X?

Also, at least one comment, I am not sure you want to be setting the PROJECT_BINARY_DIR Variable?

What are you trying to do with this statement:

SET(PROJECT_BINARY_DIR
${CMAKE_SOURCE_DIR}/bin)

--
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Sep 27, 2007, at 2:50 PM, Marie-Christine Vallet wrote:


Hi,
I have a project which in which I create a library and then I use this library with my executable. The way I set it up seem to be working on
linux (fedora) but it does not work on mac ox10.
Could someone tell me what I am doing wrong,
Thanks,
Marie

Project tree

*Projectdir
 **mdi
 **skinmesh

in my project directory I have the following cmake file :

--------------
project(mdi C Fortran CXX)


cmake_minimum_required(VERSION 2.4.0)


SET(PROJECT_BINARY_DIR
${CMAKE_SOURCE_DIR}/bin)

SET(LIBRARY_OUTPUT_PATH
${CMAKE_SOURCE_DIR}/lib)

# tell cmake to process CMakeLists.txt in these subdirectory
#they have to be added separately for it to work
#this subdirectory will create a lib so I put the lib in the lib folder
add_subdirectory(
        skinmesh
${PROJECT_BINARY_DIR}
        )


#this add the executable in the bin directory
add_subdirectory (
                mdi
${PROJECT_BINARY_DIR}
                )

--------------

In the mdi directory I have the following cmake file (part of it anyay) :


--------------

[..]


SET(SKINMESH_LIBRARIES
${LIBRARY_OUTPUT_PATH}/libskinmesh.a
)
SET(SKINMESH_INCLUDE_DIR
${CMAKE_SOURCE_DIR}/skinmesh
)
SET(INCLUDE_DIR
                ${INCLUDE_DIR}
${SKINMESH_INCLUDE_DIR}

)
SET(LIBRARIES
         ${LIBRARIES}
        ${SKINMESH_LIBRARIES})



[..]

# Mac configuration
 IF ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )

        
                #setting flags
                SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -mp1 -Kc++ -Dintel")
                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -mp1 -Kc++ -Dintel")

                   #equivalent to ldflag
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} - bind_at_load")

ENDIF ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )


#VARIABLE INITIALISATION

# set source files

[..]

SET(mdi_EXECUTABLE
                 ${mdi_SRCS}
                 ${mdi_UIS_H}
                 ${mdi_MOC_SRCS}
                 ${mdi_RCC_SRCS}
)



INCLUDE_DIRECTORIES(${INCLUDE_DIR})


 link_directories (${PROJECT_BINARY_DIR}/skinmesh)

# create an executable file named "mdi" from the source files in the
variable "mdi_SRCS".

ADD_EXECUTABLE ( mdi
 ${mdi_EXECUTABLE}
               )


TARGET_LINK_LIBRARIES ( mdi
                        ${LIBRARIES}
                      )


-------------




In the skinmesh directory I have the following cmake file (part of it anyay) :


-------------
# create an executable file named "skinmesh" from the source files in the
variable "skinmesh_SRCS".
ADD_LIBRARY ( skinmesh STATIC
                 ${skinmesh_SRCS}
               )

#set the linker language
SET_TARGET_PROPERTIES(skinmesh
        PROPERTIES
        LINKER_LANGUAGE CXX
        )

[..]


# Mac configuration
 IF ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )

                #setting flags
                SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -c -O3 -mp1 -Kc++ -Dintel")
                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -c -O3 -mp1 -Kc++ 
-Dintel")
SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -c -u -O3 -mp1 - w90 -w95
-cpp ")

#equivalent to ldflag
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -O3 -Kc++ - mp1
-bind_at_load")

ENDIF ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )

 INCLUDE_DIRECTORIES (${INCLUDE_DIR})

TARGET_LINK_LIBRARIES (skinmesh
                ${PROJECT_LIBRARIES}
        )


_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to