Some additional info. Here is my cmakelists.txt for the vector3_scalar module: PROJECT(vector3_scalar) SET(CMAKE_MACOSX_RPATH 1)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../common) SET(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../common/common_structs.h) SET(SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/vector3_scalar.c ${HEADER_FILES}) ADD_LIBRARY(vector3_scalar SHARED ${SRC_FILES}) now my cmakelists.txt for my matrix4_scalar module. This one depends on vector3_scalar PROJECT(matrix4_scalar) SET(CMAKE_MACOSX_RPATH 1) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../common ${CMAKE_CURRENT_SOURCE_DIR}/../vector3_scalar ${CMAKE_CURRENT_SOURCE_DIR}/../vector3_scalar/headers) SET(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../common/common_structs.h ${CMAKE_CURRENT_SOURCE_DIR}/../vector3_scalar/headers/vector3_scalar.h ${CMAKE_CURRENT_SOURCE_DIR}/headers/matrix4_scalar.h) SET(SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/matrix4_scalar.c ${HEADER_FILES}) ADD_LIBRARY(matrix4_scalar SHARED ${SRC_FILES}) TARGET_LINK_LIBRARIES(matrix4_scalar vector3_scalar) I am having trouble because when running cmake I get this error that says no rule to make target Scanning dependencies of target vector3_scalar [ 25%] Building C object source/core_math/vector3_scalar/CMakeFiles/vector3_scalar.dir/sr c/vector3_scalar.c.o [ 50%] Linking C shared library $(CMAKE_BINARY_DIR)/lib/libvector3_scalar.dylib [ 50%] Built target vector3_scalar Scanning dependencies of target matrix4_scalar [ 75%] Building C object source/core_math/matrix4_scalar/CMakeFiles/matrix4_scalar.dir/sr c/matrix4_scalar.c.o make[2]: *** No rule to make target `source/core_math/vector3_scalar//Users/blubee/SDL/pr oject/build/lib/libvector3_scalar.dylib', needed by `source/core_math/matrix4_scalar//Use rs/blubee/SDL/project/build/lib/libmatrix4_scalar.dylib'. Stop. make[1]: *** [source/core_math/matrix4_scalar/CMakeFiles/matrix4_scalar.dir/all] Error 2 make: *** [all] Error 2 On Mon, Oct 19, 2015 at 5:58 AM, Owen Alanzo Hogarth <gurenc...@gmail.com> wrote: > I am having some trouble with my cmake build. I recently redesigned the > physical layout of my files so that it'll be a bit easier to maintain in > the long run. > > I have my project structure setup like this. > > MAIN_PROJECT/ > project/main.c # this is the executable > resources/... # a folder filled with resources > source/ > source/moduleA/moduleA.h #includes all headers for this module > #a user would just import > moduleA.h > > source/moduleA/headers/header1.h header2.h > source/moduleA/src/source1.c source2.c > source/moduleA/common/common_structs.h #holds common structs for > > #all src files in this module > > > with my project re-organized like this and try to build my shared > libraries I get no output. > > For example main cmakelists.txt file > > PROJECT(project) > CMAKE_MINIMUM_REQUIRED(VERSION 2.8) > > SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $(CMAKE_BINARY_DIR)/lib) > SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY $(CMAKE_BINARY_DIR)/lib) > SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY $(CMAKE_BINARY_DIR)/bin) > > SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules) > > ADD_SUBDIRECTORY(source) > > FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/resources/ DESTINATION > ${CMAKE_CURRENT_BINARY_DIR}/bin/resources/) > > this is one module within the source folder, a matrix4 > > PROJECT(matrix4_scalar) > > INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../common") > > INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../vector3_scalar/headers/vector3_scalar.h") > > SET(HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../common/common_structs.h" > "${CMAKE_CURRENT_SOURCE_DIR}/../vector3_scalar/headers/vector3_scalar.h") > > > SET(SRC_FILES src/matrix4_scalar.c ${HEADER_FILES}) > > ADD_LIBRARY(matrix4_scalar SHARED ${SRC_FILES}) > > TARGET_LINK_LIBRARIES(matrix4_scalar vector3_scalar) > > > > The vector3 class is built in a similar way but has no outside > dependencies except for the common_struct.h header file. > > This matrix class depends on the vector3 class so I have it as a target > link library. > > When I build like this I get no output to my lib directories and I am not > sure what's going on. >
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake